﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Business;
using Should;

namespace UnitTestBokning
{
    [TestClass]
    public class TestAlertMessage
    {
        AlertMessage.MessageData alertMessageData = new AlertMessage.MessageData();

        [TestMethod]
        public void AlertMessage_DontShowAlertMessageWhenStringIsWrong()
        {
            alertMessageData = AlertMessage.OutputAlertMessage("This string doesn't exist as a valid error message");
            alertMessageData.alertMessageColor.ShouldEqual(AlertMessage.AlertMessageColors.none);

            alertMessageData = AlertMessage.OutputAlertMessage("");
            alertMessageData.alertMessageColor.ShouldEqual(AlertMessage.AlertMessageColors.none);
        }

        [TestMethod]
        public void AlertMessage_ShowCorrectColorAndMessageBasedOnInput()
        {
            alertMessageData = AlertMessage.OutputAlertMessage("error");
            alertMessageData.alertMessageColor.ShouldEqual(AlertMessage.AlertMessageColors.danger);
            alertMessageData.Message.ShouldEqual("Ett fel uppstod. Försök igen");

            alertMessageData = AlertMessage.OutputAlertMessage("userAdded");
            alertMessageData.alertMessageColor.ShouldEqual(AlertMessage.AlertMessageColors.success);
            alertMessageData.Message.ShouldEqual("Du har lagts till i konferenssystemet!");
        }
    }
}
